package Long.Lu.Service.Impl;

import Long.Lu.Dao.ContractDao;
import Long.Lu.Service.ContractService;
import Long.Lu.pojo.Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ContractServiceImpl implements ContractService {
    @Autowired
    private ContractDao contractDao;

    @Override
    public List<Contract> selectAll() {
        return contractDao.findAll();
    }

    @Override
    public boolean delContract(Integer contractId) {
        try {
            contractDao.deleteContractByContractId(contractId);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}
